<?php

namespace app\common\model;

use app\common\model\BaseModel;


class CarCate extends BaseModel
{

    

    

    // 表名
    protected $name = 'car_cate';
    
    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [

    ];


	public function getTypeList()
	{
		return ['1' => __('品牌'), '2' => __('类型')];
	}

    public static function getColumnList($where = []){
        return self::where($where)->order('id', 'desc')->column('cate_name', 'id');
    }


    public function childCate(){
	    return $this->hasMany('car_cate', 'pid', 'id');
    }



}
